package stars.enums;

import java.util.EnumSet;

public enum EStarSystemType {
	
	SINGLE (1.0, 1, 1, 1, 0, 0),
	
	BINARY_CENTER (0.5, 2, 1, 2, 0, 0),
	BINARY_ORBIT (0.5, 2, 2, 1, 1, 0),
	
	TRINARY_CENTER (0.2, 3, 1, 3, 0, 0),
	TRINARY_BIN_CENTER_SIN_ORBIT (0.5, 3, 2, 2, 1, 0),
	TRINARY_SIN_CENTER_BIN_ORBIT (0.2, 3, 2, 1, 2, 0),
	TRINARY_ALL_ORBIT (0.1, 3, 3, 1, 1, 1),
	
	QUAD_CENTER (0.05, 4, 1, 4, 0, 0),
	QUAD_TRI_CENTER_SINGLE_ORBIT (0.2, 4, 2, 3, 1, 0),
	QUAD_BIN_CENTER_BIN_ORBIT (0.5, 4, 2, 2, 2, 0),
	QUAD_BIN_CENTER_SIN_ORBIT_SIN_ORBIT (0.25, 4, 3, 2, 1, 1);
	
	private final double probability;
	private final int numStars;
	private final int numGroups;
	private final int numStarsGroup1;
	private final int numStarsGroup2;
	private final int numStarsGroup3;
	
	public static final EnumSet<EStarSystemType> SYSTEM_CATEGORIES = EnumSet.of(
			SINGLE, 
			BINARY_CENTER, 
			TRINARY_CENTER, 
			QUAD_CENTER);
	
	public static final EnumSet<EStarSystemType> SINGLE_SYSTEMS = EnumSet.of(
			SINGLE);
	
	public static final EnumSet<EStarSystemType> BINARY_SYSTEMS = EnumSet.of(
			BINARY_CENTER, 
			BINARY_ORBIT);
	
	public static final EnumSet<EStarSystemType> TRINARY_SYSTEMS = EnumSet.of(
			TRINARY_CENTER,
			TRINARY_BIN_CENTER_SIN_ORBIT,
			TRINARY_SIN_CENTER_BIN_ORBIT,
			TRINARY_ALL_ORBIT);
	
	public static final EnumSet<EStarSystemType> QUAD_SYSTEMS = EnumSet.of(
			QUAD_CENTER,
			QUAD_TRI_CENTER_SINGLE_ORBIT,
			QUAD_BIN_CENTER_BIN_ORBIT,
			QUAD_BIN_CENTER_SIN_ORBIT_SIN_ORBIT);
	
	EStarSystemType(double probability, int numStars, int numGroups, 
			int numStarsGroup1, int numStarsGroup2, int numStarsGroup3) {
		this.probability = probability;
		this.numStars = numStars;
		this.numGroups = numGroups;
		this.numStarsGroup1 = numStarsGroup1;
		//System.out.println("Group1: " + numStarsGroup1);
		this.numStarsGroup2 = numStarsGroup2;
		this.numStarsGroup3 = numStarsGroup3;
	}
	
	public double getProbability() {
		return probability;
	}
	
	public int getNumStars() {
		return numStars;
	}
	
	public int getNumGroups() {
		return numGroups;
	}
	
	public int getNumStarsGroup1() {
		return numStarsGroup1;
	}
	
	public int getNumStarsGroup2() {
		return numStarsGroup2;
	}
	
	public int getNumStarsGroup3() {
		return numStarsGroup3;
	}

}
